#include<iostream>
#include<string>
using namespace std;


void Test()
{
	string s1("Hello world");
	string s2(s1);
	for (auto i : s2)
	{
		cout << i << " ";
	}
	cout << endl;


	for (size_t i = 0; i < s1.size(); i++)
	{
		cout << s1[i] << " ";
	}
	cout << endl;


	string::iterator it = s1.begin();
	while (it != s1.end())
	{
		cout << *it << " ";
		it++;
	}
	cout << endl;

	string::reverse_iterator it1 = s1.rbegin();
	while (it1 != s1.rend())
	{
		cout << *it1 << " ";
		it1++;
	}
	cout << endl;


	string::iterator st1 = s1.begin();
	while (st1 != s1.end())
	{
		cout << *st1 << " ";
		st1++;
	}
	cout << endl;

	string::iterator st2 = s1.begin();
	while (st2 != s1.end())
	{
		cout << *st2 << " ";
		st2++;
	}
	cout << endl;
}
int main()
{
	Test();

	return 0;
}